﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace SimpleData.Infrastructure.Utils
{
	public sealed class NameValueFormatter
	{
		private const string PropertyPlaceHolder = "";

		public NameValueFormatter()
			: this( String.Empty )
		{ }

		public NameValueFormatter( string template )
		{
			this.Template = template;
			this.Values = new Dictionary<string, object>();
		}

		public string Template
		{ get; set; }

		public Dictionary<string, object> Values
		{ get; private set; }

		public string Format()
		{
			if ( String.IsNullOrEmpty( this.Template ) )
				return String.Empty;
			else if ( this.Values.Count == 0 )
				return this.Template;
			else
			{
				Regex parser = new Regex( "" );

				return parser.Replace( this.Template, String.Empty );
			}
		}
	}
}
